function pmAdaptors_CreateFcn(h, e)
%PMADAPTORS_CREATEFCN Summary of this function goes here
%   Detailed explanation goes here

ui.PopupMenu.Style={'style', 'PopupMenu', 'BackgroundColor', [1 1 1], 'units', 'normalized'};
set(h, ...
    'string', InstalledAdaptorsWithDevices, ...
    'tag', 'pmAdaptors');
set(h, ui.PopupMenu.Style{:});

mainfig = findobj('tag', 'dhaqtool');
IniFile= getappdata(mainfig, 'IniFile');

Adaptor= inifile(IniFile,'read',{'VideoInput','','Adaptor'});
if isempty(Adaptor{1})
    uicontrol_SelectedIndex(h, 1)
else
    uicontrol_SelectedItem(h, Adaptor{1})
end

end

function list=InstalledAdaptorsWithDevices

    list={};
    imaqhw= imaqhwinfo;
    InstalledAdaptors= imaqhw.InstalledAdaptors;
    
    for Adaptor= InstalledAdaptors
        imaqhw=imaqhwinfo(Adaptor{1});
        if numel(imaqhw.DeviceIDs) > 0
            list{end+1}= Adaptor{1};
        end
    end

end

